package com.lc.cehui.ui.adapter;

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;

import java.util.List;

public class TabViewPagerAdapter extends FragmentPagerAdapter {

    private Context mContext;
    private List<Fragment> fragments;
    private List<String> relist;

    public TabViewPagerAdapter(@NonNull FragmentManager fm, Context mContext, List<Fragment> fragments, List<String> relist) {
        super(fm);
        this.mContext = mContext;
        this.fragments = fragments;
        this.relist = relist;
    }

    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {

        return relist.get(position);
    }
}
